﻿using Known.Extensions;

namespace KnownCMS.Admin;

/// <summary>
/// KnownCMS管理端配置类。
/// </summary>
public static class AppAdmin
{
    internal const string Content = "Content";
    internal const string Interact = "Interact";

    /// <summary>
    /// 添加KnownCMS管理端应用。
    /// </summary>
    /// <param name="services">依赖注入服务。</param>
    public static void AddKnownCMSAdmin(this IServiceCollection services)
    {
        //Stopwatcher.Enabled = true;
        var assembly = typeof(AppAdmin).Assembly;
        services.AddKnownCMS(option => option.IsSite = false);
        services.AddServices(assembly);
        //添加模块
        Config.AddModule(assembly);
        Config.Modules.AddItem("0", Content, "内容管理", "file-search", 2);
        Config.Modules.AddItem("0", Interact, "交流管理", "read", 3);
    }
}